while True:
    id = input('请输入 ID（长度不能超过8位，且只能由数字、字母、下划线组成）：')

    if len(id) < 1:
        print("请输入 ID！")
    if len(id) > 8:
        print("ID 长度不能超过 8 位！")
    if 1 <= len(id) <= 8:
        flag = True
        for i in range(len(id)):
            word = ord(id[i])
            if not ((48 <= word <= 57) or (65 <= word <= 90) or word == 95 or (97 <= word <= 122)):
                print("ID 只能由数字、字母、下划线组成！")
                flag = False
                break
        if flag:
            print("ID 输入成功！您输入的 ID 为：{}".format(id))
            break
while True:
    email = input('请输入 Email：')

    if len(email)<1:
        print('请输入 Email！')
    if len(email)>=1:
        flag = False
        for i in range(len(email)):
            word = ord(email[i])
            if word == 64:
                flag = True
                break
        if flag:
            print("输入成功，您输入的 Email 为：{}".format(email))
        else:
            print("请输入正确的 Email!")
